#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	int n, p;
	cin >> n;
	double time, distance;
	for(int i = 0; i < n; i++)
	{
		double x, y;
		cin >> x >> y >> p;
		distance = sqrt(x * x + y * y);
		time += p * 1 + p * 0.5 + 2 * distance / 50;
	}
	cout << (int)ceil(time) << endl;
	return 0;
}
